package com.xhs.zdl.demo.treeNode;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.unnamed.b.atv.model.TreeNode;
import com.unnamed.b.atv.view.AndroidTreeView;
import com.xhs.zdl.demo.R;

public class TreeViewDemoActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tree_view_demo);

        initView();
    }

    private void initView() {
        TreeNode root = TreeNode.root();
        TreeNode parent = new TreeNode("安装配置");
        TreeNode child0 = new TreeNode("ChildNode0");
        TreeNode child1 = new TreeNode("ChildNode1");
        parent.addChildren(child0, child1);
        root.addChild(parent);

        AndroidTreeView tView = new AndroidTreeView(this, root);
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.treeViewLayout);
        relativeLayout.addView(tView.getView());
    }
}
